package com.wn.common.runner;

import com.wn.service.BookService;
import com.wn.service.BookTypeService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.CommandLineRunner;
import org.springframework.stereotype.Component;

@Component
@Slf4j
public class InitTopSaleRunner implements CommandLineRunner {
    @Autowired
    private BookService bookService;
    @Autowired
    private BookTypeService bookTypeService;
    // 热销榜数据初始化


    @Override
    public void run(String... args) throws Exception {
        bookService.findTopSales(1, 12);
        bookTypeService.findAll();
        log.info("热销榜数据初始化完成");
    }
}